<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateCustomerTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"  />
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="3">
                    <h:outputLabel value="#{bundle.CustomerLabel_id}" for="id" />
                    <h:inputText readonly="true" id="id" value="#{clienteController.selected.id}" 
                                 title="#{bundle.CustomerTitle_id}" 
                                 />
                    <h:message for="id" styleClass="error"/>

                    <h:outputLabel value="#{bundle.CustomerLabel_name}*" for="nome"
                                   />
                    <h:inputText id="nome" value="falta implementar login" title="#{bundle.CustomerTitle_name}" 
                                 required="true" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="nome" styleClass="error"/>

                    <h:outputLabel value="#{bundle.CustomerLabel_login}*" for="login"
                                   />
                    <h:inputText id="login" value="falta implementar login" title="#{bundle.CustomerTitle_login}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="login" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_password}*" for="password"
                                   />
                    <h:inputText id="password" value="falta implementar password" title="#{bundle.CustomerTitle_password}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="password" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_newpassword}*" for="newpassword"
                                   />
                    <h:inputText id="newpassword" value="falta implementar newpassword" title="#{bundle.CustomerTitle_newpassword}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="newpassword" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_confirmpassword}*" for="confirmpassword"
                                   />
                    <h:inputText id="confirmpassword" value="falta implementar confirmpassword" title="#{bundle.CustomerTitle_confirmpassword}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="confirmpassword" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_email}*" for="email"
                                   />
                    <h:inputText id="email" value="falta implementar email" title="#{bundle.CustomerTitle_email}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="email" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_rua}*" for="rua"
                                   />
                    <h:inputText id="rua" value="#{clienteController.selected.enderecoLogradouro}" title="#{bundle.CustomerTitle_rua}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="rua" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_numero}*" for="numero"
                                   />
                    <h:inputText id="numero" value="#{clienteController.selected.enderecoNumero}" title="#{bundle.CustomerTitle_numero}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="numero" styleClass="error"/>

                    <h:outputLabel value="#{bundle.CustomerLabel_complemento}*" for="complemento"
                                   />
                    <h:inputText id="complemento" value="#{clienteController.selected.enderecoComplemento}" title="#{bundle.CustomerTitle_complemento}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="complemento" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_bairro}*" for="bairro"/>
                    <h:inputText id="bairro" value="#{clienteController.selected.enderecoBairro}" title="#{bundle.CustomerTitle_bairro}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="bairro" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_cep}*" for="cep"/>

                    <h:inputText id="cep" value="#{clienteController.selected.enderecoCep}" title="#{bundle.CustomerTitle_cep}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="cep" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_cidade}*" for="cidade"/>
                    <h:inputText id="cidade" value="#{clienteController.selected.enderecoCidade}" title="#{bundle.CustomerTitle_cidade}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="cidade" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_uf}*" for="uf"/>
                    <h:inputText id="uf" value="#{clienteController.selected.enderecoUf}" title="#{bundle.CustomerTitle_uf}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="uf" styleClass="error"/>

                    <h:outputLabel value="#{bundle.CustomerLabel_celular}*" for="celular"/>
                    <h:inputText id="celular" value="#{clienteController.selected.telefoneCelular}" title="#{bundle.CustomerTitle_celular}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="celular" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_residencial}*" for="residencial"/>
                    <h:inputText id="residencial" value="#{clienteController.selected.telefoneResidencial}" title="#{bundle.CustomerTitle_residencial}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="residencial" styleClass="error"/>
                    <h:outputLabel value="#{bundle.CustomerLabel_comercial}*" for="comercial"/>
                    <h:inputText id="comercial" value="#{clienteController.selected.telefoneComercial}" title="#{bundle.CustomerTitle_comercial}" 
                                 required="false" 
                                 requiredMessage="#{bundle.nomeCustomerRequired}"
                                 validator="#{clienteController.validaCliente(context, componentToValidate, value)}"
                                 />
                    <h:message for="comercial" styleClass="error"/>
                </h:panelGrid>
                <h:commandLink class="botao" action="#{clienteController.create}" value="#{bundle.SaveLink}" id="comand" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
